package com.yihong.common.util;

/**
 * @ClassName AjaxJson
 * @Description 接口返回数据格式
 * @Author 孟志浩
 * @Date 2019/3/19 14:04
 **/
public class AjaxJson<T> {

    // 状态码
    private int code = 200;
    // 信息
    private String message = "成功";

    // 数据
    T data;


    public AjaxJson(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public AjaxJson(int code, T data) {
        this.code = code;
        this.data = data;
    }

    public AjaxJson(String message, T data) {
        this.message = message;
        this.data = data;
    }

    public AjaxJson(T data) {
        this.data = data;
    }

    public AjaxJson(String message) {
        this.message = message;
    }

    public AjaxJson(int code, String message, T data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public AjaxJson() {}

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }
}
